/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using IQIGame.Onigao.Framework;
using System.Collections.Generic;
using System.Linq;
using System;
using NetProtocol.Enum;

namespace NetProtocol.POD {

	/// <summary>
	/// 玩家数据结构
	/// module : structs
	/// </summary>
	public class PlayerPOD : IPOD 
    {
        public readonly static Func<PlayerPOD> FACTORY = () => new PlayerPOD();
		public static Func<PlayerPOD> DynamicFactory = FACTORY;
        
		/*-- members --*/
		/// <summary>
        ///  玩家id
        /// </summary>
		public long pid;
		/// <summary>
        ///  用户id
        /// </summary>
		public string uid;
		/// <summary>
        ///  GUID
        /// </summary>
		public int guid;
		/// <summary>
        ///  用户平台id
        /// </summary>
		public string openId;
		/// <summary>
        ///  角色id
        /// </summary>
		public int roleCid;
		/// <summary>
        ///  创建时间(毫秒时间戳)
        /// </summary>
		public long createTime;
		/// <summary>
        ///  大区id
        /// </summary>
		public string areaId;
		/// <summary>
        ///  游戏服务器id
        /// </summary>
		public string gameServerId;
		/// <summary>
        ///  平台标示
        /// </summary>
		public string sdkName;
		/// <summary>
        ///  注册时的自定义渠道号
        /// </summary>
		public string channelNo;
		/// <summary>
        ///  玩家等级
        /// </summary>
		public int level;
		/// <summary>
        ///  经验
        /// </summary>
		public int exp;
		/// <summary>
        ///  昵称
        /// </summary>
		public string playerName;
		/// <summary>
        ///  头像
        /// </summary>
		public int avatar;
		/// <summary>
        ///  头像框id
        /// </summary>
		public int avatarFrame;
		/// <summary>
        ///  个人简介	
        /// </summary>
		public string intro;
		/// <summary>
        ///  称号
        /// </summary>
		public int title;
		/// <summary>
        ///  看板娘(灵魂id)
        /// </summary>
		public int kanban;
		/// <summary>
        ///  付费点
        /// </summary>
		public int payPoint;
		/// <summary>
        ///  累计充值金额
        /// </summary>
		public int sumPay;
		/// <summary>
        /// 已经开启的功能id
        /// </summary>
        private List<int> m_functionTypes;
		/// <summary>
        /// 玩家参数
        /// </summary>
        private Dictionary<int, int> m_playerParams;
		/// <summary>
        /// 玩家设置数据
        /// </summary>
        private Dictionary<string, string> m_settingData;
		/// <summary>
        /// 基础道具
        /// </summary>
        private Dictionary<int, int> m_basicItems;
		/// <summary>
        /// 实例道具
        /// </summary>
        private List<ItemPOD> m_items;
		/// <summary>
        /// 道具冷却信息 cid => lastUsedTime
        /// </summary>
        private Dictionary<int, int> m_itemCdInfo;
		/// <summary>
        /// 道具的欠债
        /// </summary>
        private Dictionary<int, int> m_itemDebts;
		/// <summary>
        /// 兑换记录，cid => count
        /// </summary>
        private Dictionary<int, int> m_exchangeRecords;
		/// <summary>
        ///  灵魂信息
        /// </summary>
        private List<SoulPOD> m_souls;
		/// <summary>
        ///  英雄信息
        /// </summary>
        private List<HeroPOD> m_heros;
		/// <summary>
        ///  默认编队id
        /// </summary>
		public int defFormId;
		/// <summary>
        ///  编队信息(全部)
        /// </summary>
        private List<FormationPOD> m_forms;
		/// <summary>
        /// 任务
        /// </summary>
        private List<QuestPOD> m_quests;
		/// <summary>
        /// 已提交任务
        /// </summary>
        private List<int> m_committedQuestList;
		/// <summary>
        /// 已失败任务
        /// </summary>
        private List<int> m_failQuestList;
		/// <summary>
        /// 新邮件数量(普通邮件)
        /// </summary>
		public int newMailCount;
		/// <summary>
        /// 装备皮肤
        /// </summary>
        private List<int> m_equipSkins;
		/// <summary>
        /// 快捷栏道具id
        /// </summary>
		public long portableItemId;
		/// <summary>
        /// 当前追踪任务
        /// </summary>
		public int trackQuestCid;
		/// <summary>
        /// 商城物品购买次数限制记录,会根据刷新类型重置, key=mallItemCid, value=次数
        /// </summary>
        private Dictionary<int, int> m_mallBuyCountRecords;
		/// <summary>
        /// 商城开始售卖时间,key=mallItemCid,value=开始时间(时间戳,秒)	
        /// </summary>
        private Dictionary<int, int> m_mallStartSellTime;
		/// <summary>
        /// 充值挡位次数
        /// </summary>
        private Dictionary<int, int> m_payCount;
		/// <summary>
        /// 月卡状态，key=cid，value=过期时间，时间戳（秒）
        /// </summary>
        private Dictionary<int, int> m_monthCard;
		/// <summary>
        /// 宠物数据，cid可能重复
        /// </summary>
        private List<PetPOD> m_pets;
		/// <summary>
        /// 宠物仓库容量
        /// </summary>
		public int petBagCapacity;
		/// <summary>
        /// 主城数据
        /// </summary>
		public MainCityPOD mainCityPOD;
		/// <summary>
        /// 关卡记录
        /// </summary>
        private List<LevelRecordPOD> m_levelRecords;
		/// <summary>
        /// 好友
        /// </summary>
        private List<FriendPOD> m_friends;
		
		
        public List<int> functionTypes
        {
            get
            {
                if(m_functionTypes == null)
                {
                    m_functionTypes = new();
                }
                return m_functionTypes;
            }
            private set => m_functionTypes = value;
        }
        public List<int> unsafe_functionTypes
        {
        	get => m_functionTypes;
        	set => m_functionTypes = value;
        }
        public Dictionary<int, int> playerParams
        {
            get
            {
                if(m_playerParams == null)
                {
                    m_playerParams = new();
                }
                return m_playerParams;
            }
            private set => m_playerParams = value;
        }
        public Dictionary<int, int> unsafe_playerParams
        {
        	get => m_playerParams;
        	set => m_playerParams = value;
        }
        public Dictionary<string, string> settingData
        {
            get
            {
                if(m_settingData == null)
                {
                    m_settingData = new();
                }
                return m_settingData;
            }
            private set => m_settingData = value;
        }
        public Dictionary<string, string> unsafe_settingData
        {
        	get => m_settingData;
        	set => m_settingData = value;
        }
        public Dictionary<int, int> basicItems
        {
            get
            {
                if(m_basicItems == null)
                {
                    m_basicItems = new();
                }
                return m_basicItems;
            }
            private set => m_basicItems = value;
        }
        public Dictionary<int, int> unsafe_basicItems
        {
        	get => m_basicItems;
        	set => m_basicItems = value;
        }
        public List<ItemPOD> items
        {
            get
            {
                if(m_items == null)
                {
                    m_items = new();
                }
                return m_items;
            }
            private set => m_items = value;
        }
        public List<ItemPOD> unsafe_items
        {
        	get => m_items;
        	set => m_items = value;
        }
        public Dictionary<int, int> itemCdInfo
        {
            get
            {
                if(m_itemCdInfo == null)
                {
                    m_itemCdInfo = new();
                }
                return m_itemCdInfo;
            }
            private set => m_itemCdInfo = value;
        }
        public Dictionary<int, int> unsafe_itemCdInfo
        {
        	get => m_itemCdInfo;
        	set => m_itemCdInfo = value;
        }
        public Dictionary<int, int> itemDebts
        {
            get
            {
                if(m_itemDebts == null)
                {
                    m_itemDebts = new();
                }
                return m_itemDebts;
            }
            private set => m_itemDebts = value;
        }
        public Dictionary<int, int> unsafe_itemDebts
        {
        	get => m_itemDebts;
        	set => m_itemDebts = value;
        }
        public Dictionary<int, int> exchangeRecords
        {
            get
            {
                if(m_exchangeRecords == null)
                {
                    m_exchangeRecords = new();
                }
                return m_exchangeRecords;
            }
            private set => m_exchangeRecords = value;
        }
        public Dictionary<int, int> unsafe_exchangeRecords
        {
        	get => m_exchangeRecords;
        	set => m_exchangeRecords = value;
        }
        public List<SoulPOD> souls
        {
            get
            {
                if(m_souls == null)
                {
                    m_souls = new();
                }
                return m_souls;
            }
            private set => m_souls = value;
        }
        public List<SoulPOD> unsafe_souls
        {
        	get => m_souls;
        	set => m_souls = value;
        }
        public List<HeroPOD> heros
        {
            get
            {
                if(m_heros == null)
                {
                    m_heros = new();
                }
                return m_heros;
            }
            private set => m_heros = value;
        }
        public List<HeroPOD> unsafe_heros
        {
        	get => m_heros;
        	set => m_heros = value;
        }
        public List<FormationPOD> forms
        {
            get
            {
                if(m_forms == null)
                {
                    m_forms = new();
                }
                return m_forms;
            }
            private set => m_forms = value;
        }
        public List<FormationPOD> unsafe_forms
        {
        	get => m_forms;
        	set => m_forms = value;
        }
        public List<QuestPOD> quests
        {
            get
            {
                if(m_quests == null)
                {
                    m_quests = new();
                }
                return m_quests;
            }
            private set => m_quests = value;
        }
        public List<QuestPOD> unsafe_quests
        {
        	get => m_quests;
        	set => m_quests = value;
        }
        public List<int> committedQuestList
        {
            get
            {
                if(m_committedQuestList == null)
                {
                    m_committedQuestList = new();
                }
                return m_committedQuestList;
            }
            private set => m_committedQuestList = value;
        }
        public List<int> unsafe_committedQuestList
        {
        	get => m_committedQuestList;
        	set => m_committedQuestList = value;
        }
        public List<int> failQuestList
        {
            get
            {
                if(m_failQuestList == null)
                {
                    m_failQuestList = new();
                }
                return m_failQuestList;
            }
            private set => m_failQuestList = value;
        }
        public List<int> unsafe_failQuestList
        {
        	get => m_failQuestList;
        	set => m_failQuestList = value;
        }
        public List<int> equipSkins
        {
            get
            {
                if(m_equipSkins == null)
                {
                    m_equipSkins = new();
                }
                return m_equipSkins;
            }
            private set => m_equipSkins = value;
        }
        public List<int> unsafe_equipSkins
        {
        	get => m_equipSkins;
        	set => m_equipSkins = value;
        }
        public Dictionary<int, int> mallBuyCountRecords
        {
            get
            {
                if(m_mallBuyCountRecords == null)
                {
                    m_mallBuyCountRecords = new();
                }
                return m_mallBuyCountRecords;
            }
            private set => m_mallBuyCountRecords = value;
        }
        public Dictionary<int, int> unsafe_mallBuyCountRecords
        {
        	get => m_mallBuyCountRecords;
        	set => m_mallBuyCountRecords = value;
        }
        public Dictionary<int, int> mallStartSellTime
        {
            get
            {
                if(m_mallStartSellTime == null)
                {
                    m_mallStartSellTime = new();
                }
                return m_mallStartSellTime;
            }
            private set => m_mallStartSellTime = value;
        }
        public Dictionary<int, int> unsafe_mallStartSellTime
        {
        	get => m_mallStartSellTime;
        	set => m_mallStartSellTime = value;
        }
        public Dictionary<int, int> payCount
        {
            get
            {
                if(m_payCount == null)
                {
                    m_payCount = new();
                }
                return m_payCount;
            }
            private set => m_payCount = value;
        }
        public Dictionary<int, int> unsafe_payCount
        {
        	get => m_payCount;
        	set => m_payCount = value;
        }
        public Dictionary<int, int> monthCard
        {
            get
            {
                if(m_monthCard == null)
                {
                    m_monthCard = new();
                }
                return m_monthCard;
            }
            private set => m_monthCard = value;
        }
        public Dictionary<int, int> unsafe_monthCard
        {
        	get => m_monthCard;
        	set => m_monthCard = value;
        }
        public List<PetPOD> pets
        {
            get
            {
                if(m_pets == null)
                {
                    m_pets = new();
                }
                return m_pets;
            }
            private set => m_pets = value;
        }
        public List<PetPOD> unsafe_pets
        {
        	get => m_pets;
        	set => m_pets = value;
        }
        public List<LevelRecordPOD> levelRecords
        {
            get
            {
                if(m_levelRecords == null)
                {
                    m_levelRecords = new();
                }
                return m_levelRecords;
            }
            private set => m_levelRecords = value;
        }
        public List<LevelRecordPOD> unsafe_levelRecords
        {
        	get => m_levelRecords;
        	set => m_levelRecords = value;
        }
        public List<FriendPOD> friends
        {
            get
            {
                if(m_friends == null)
                {
                    m_friends = new();
                }
                return m_friends;
            }
            private set => m_friends = value;
        }
        public List<FriendPOD> unsafe_friends
        {
        	get => m_friends;
        	set => m_friends = value;
        }
		
		/*-- constructors --*/
		public PlayerPOD() {}
		public PlayerPOD(long pid, string uid, int guid, string openId, int roleCid, long createTime, string areaId, string gameServerId, string sdkName, string channelNo, int level, int exp, string playerName, int avatar, int avatarFrame, string intro, int title, int kanban, int payPoint, int sumPay, List<int> functionTypes, Dictionary<int, int> playerParams, Dictionary<string, string> settingData, Dictionary<int, int> basicItems, List<ItemPOD> items, Dictionary<int, int> itemCdInfo, Dictionary<int, int> itemDebts, Dictionary<int, int> exchangeRecords, List<SoulPOD> souls, List<HeroPOD> heros, int defFormId, List<FormationPOD> forms, List<QuestPOD> quests, List<int> committedQuestList, List<int> failQuestList, int newMailCount, List<int> equipSkins, long portableItemId, int trackQuestCid, Dictionary<int, int> mallBuyCountRecords, Dictionary<int, int> mallStartSellTime, Dictionary<int, int> payCount, Dictionary<int, int> monthCard, List<PetPOD> pets, int petBagCapacity, MainCityPOD mainCityPOD, List<LevelRecordPOD> levelRecords, List<FriendPOD> friends) {
			this.pid = pid;
			this.uid = uid;
			this.guid = guid;
			this.openId = openId;
			this.roleCid = roleCid;
			this.createTime = createTime;
			this.areaId = areaId;
			this.gameServerId = gameServerId;
			this.sdkName = sdkName;
			this.channelNo = channelNo;
			this.level = level;
			this.exp = exp;
			this.playerName = playerName;
			this.avatar = avatar;
			this.avatarFrame = avatarFrame;
			this.intro = intro;
			this.title = title;
			this.kanban = kanban;
			this.payPoint = payPoint;
			this.sumPay = sumPay;
			this.m_functionTypes = functionTypes;
			this.m_playerParams = playerParams;
			this.m_settingData = settingData;
			this.m_basicItems = basicItems;
			this.m_items = items;
			this.m_itemCdInfo = itemCdInfo;
			this.m_itemDebts = itemDebts;
			this.m_exchangeRecords = exchangeRecords;
			this.m_souls = souls;
			this.m_heros = heros;
			this.defFormId = defFormId;
			this.m_forms = forms;
			this.m_quests = quests;
			this.m_committedQuestList = committedQuestList;
			this.m_failQuestList = failQuestList;
			this.newMailCount = newMailCount;
			this.m_equipSkins = equipSkins;
			this.portableItemId = portableItemId;
			this.trackQuestCid = trackQuestCid;
			this.m_mallBuyCountRecords = mallBuyCountRecords;
			this.m_mallStartSellTime = mallStartSellTime;
			this.m_payCount = payCount;
			this.m_monthCard = monthCard;
			this.m_pets = pets;
			this.petBagCapacity = petBagCapacity;
			this.mainCityPOD = mainCityPOD;
			this.m_levelRecords = levelRecords;
			this.m_friends = friends;
		}
	      public void Serial(SOutputStream _out) {
            _out.Write_long(pid);
            _out.Write_string(uid);
            _out.Write_int(guid);
            _out.Write_string(openId);
            _out.Write_int(roleCid);
            _out.Write_long(createTime);
            _out.Write_string(areaId);
            _out.Write_string(gameServerId);
            _out.Write_string(sdkName);
            _out.Write_string(channelNo);
            _out.Write_int(level);
            _out.Write_int(exp);
            _out.Write_string(playerName);
            _out.Write_int(avatar);
            _out.Write_int(avatarFrame);
            _out.Write_string(intro);
            _out.Write_int(title);
            _out.Write_int(kanban);
            _out.Write_int(payPoint);
            _out.Write_int(sumPay);
            _out.Write_list_int(m_functionTypes); 
            _out.Write_map_int_int(m_playerParams);
            _out.Write_map_string_string(m_settingData);
            _out.Write_map_int_int(m_basicItems);
            _out.Write_list_pod(m_items);
            _out.Write_map_int_int(m_itemCdInfo);
            _out.Write_map_int_int(m_itemDebts);
            _out.Write_map_int_int(m_exchangeRecords);
            _out.Write_list_pod(m_souls);
            _out.Write_list_pod(m_heros);
            _out.Write_int(defFormId);
            _out.Write_list_pod(m_forms);
            _out.Write_list_pod(m_quests);
            _out.Write_list_int(m_committedQuestList); 
            _out.Write_list_int(m_failQuestList); 
            _out.Write_int(newMailCount);
            _out.Write_list_int(m_equipSkins); 
            _out.Write_long(portableItemId);
            _out.Write_int(trackQuestCid);
            _out.Write_map_int_int(m_mallBuyCountRecords);
            _out.Write_map_int_int(m_mallStartSellTime);
            _out.Write_map_int_int(m_payCount);
            _out.Write_map_int_int(m_monthCard);
            _out.Write_list_pod(m_pets);
            _out.Write_int(petBagCapacity);
            _out.Write_pod(mainCityPOD);
            _out.Write_list_pod(m_levelRecords);
            _out.Write_list_pod(m_friends);
        }
        
        public void UnSerial(SInputStream _in) {
            if(!_in.HasRemaining()) return;
            pid = _in.Read_long();
            if(!_in.HasRemaining()) return;
            uid = _in.Read_string();
            if(!_in.HasRemaining()) return;
            guid = _in.Read_int();
            if(!_in.HasRemaining()) return;
            openId = _in.Read_string();
            if(!_in.HasRemaining()) return;
            roleCid = _in.Read_int();
            if(!_in.HasRemaining()) return;
            createTime = _in.Read_long();
            if(!_in.HasRemaining()) return;
            areaId = _in.Read_string();
            if(!_in.HasRemaining()) return;
            gameServerId = _in.Read_string();
            if(!_in.HasRemaining()) return;
            sdkName = _in.Read_string();
            if(!_in.HasRemaining()) return;
            channelNo = _in.Read_string();
            if(!_in.HasRemaining()) return;
            level = _in.Read_int();
            if(!_in.HasRemaining()) return;
            exp = _in.Read_int();
            if(!_in.HasRemaining()) return;
            playerName = _in.Read_string();
            if(!_in.HasRemaining()) return;
            avatar = _in.Read_int();
            if(!_in.HasRemaining()) return;
            avatarFrame = _in.Read_int();
            if(!_in.HasRemaining()) return;
            intro = _in.Read_string();
            if(!_in.HasRemaining()) return;
            title = _in.Read_int();
            if(!_in.HasRemaining()) return;
            kanban = _in.Read_int();
            if(!_in.HasRemaining()) return;
            payPoint = _in.Read_int();
            if(!_in.HasRemaining()) return;
            sumPay = _in.Read_int();
            if(!_in.HasRemaining()) return;
            m_functionTypes = _in.Read_list_int();
            if(!_in.HasRemaining()) return;
            m_playerParams = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_settingData = _in.Read_map_string_string();
            if(!_in.HasRemaining()) return;
            m_basicItems = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_items = _in.Read_list_pod<ItemPOD>(ItemPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_itemCdInfo = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_itemDebts = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_exchangeRecords = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_souls = _in.Read_list_pod<SoulPOD>(SoulPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_heros = _in.Read_list_pod<HeroPOD>(HeroPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            defFormId = _in.Read_int();
            if(!_in.HasRemaining()) return;
            m_forms = _in.Read_list_pod<FormationPOD>(FormationPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_quests = _in.Read_list_pod<QuestPOD>(QuestPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_committedQuestList = _in.Read_list_int();
            if(!_in.HasRemaining()) return;
            m_failQuestList = _in.Read_list_int();
            if(!_in.HasRemaining()) return;
            newMailCount = _in.Read_int();
            if(!_in.HasRemaining()) return;
            m_equipSkins = _in.Read_list_int();
            if(!_in.HasRemaining()) return;
            portableItemId = _in.Read_long();
            if(!_in.HasRemaining()) return;
            trackQuestCid = _in.Read_int();
            if(!_in.HasRemaining()) return;
            m_mallBuyCountRecords = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_mallStartSellTime = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_payCount = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_monthCard = _in.Read_map_int_int();
            if(!_in.HasRemaining()) return;
            m_pets = _in.Read_list_pod<PetPOD>(PetPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            petBagCapacity = _in.Read_int();
            if(!_in.HasRemaining()) return;
            mainCityPOD = _in.Read_pod<MainCityPOD>(MainCityPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_levelRecords = _in.Read_list_pod<LevelRecordPOD>(LevelRecordPOD.DynamicFactory);
            if(!_in.HasRemaining()) return;
            m_friends = _in.Read_list_pod<FriendPOD>(FriendPOD.DynamicFactory);
        }
		
		public PlayerPOD Clone() {
            PlayerPOD o = DynamicFactory();
            o.pid = pid;
            o.uid = uid;
            o.guid = guid;
            o.openId = openId;
            o.roleCid = roleCid;
            o.createTime = createTime;
            o.areaId = areaId;
            o.gameServerId = gameServerId;
            o.sdkName = sdkName;
            o.channelNo = channelNo;
            o.level = level;
            o.exp = exp;
            o.playerName = playerName;
            o.avatar = avatar;
            o.avatarFrame = avatarFrame;
            o.intro = intro;
            o.title = title;
            o.kanban = kanban;
            o.payPoint = payPoint;
            o.sumPay = sumPay;
            if (m_functionTypes != null) {
                o.m_functionTypes = new (m_functionTypes);
            }
            if (m_playerParams != null) {
                o.m_playerParams = new (m_playerParams);
            }
            if (m_settingData != null) {
                o.m_settingData = new (m_settingData);
            }
            if (m_basicItems != null) {
                o.m_basicItems = new (m_basicItems);
            }
            if (m_items != null) {
                o.m_items = m_items.ConvertAll(o => o?.Clone());
            }
            if (m_itemCdInfo != null) {
                o.m_itemCdInfo = new (m_itemCdInfo);
            }
            if (m_itemDebts != null) {
                o.m_itemDebts = new (m_itemDebts);
            }
            if (m_exchangeRecords != null) {
                o.m_exchangeRecords = new (m_exchangeRecords);
            }
            if (m_souls != null) {
                o.m_souls = m_souls.ConvertAll(o => o?.Clone());
            }
            if (m_heros != null) {
                o.m_heros = m_heros.ConvertAll(o => o?.Clone());
            }
            o.defFormId = defFormId;
            if (m_forms != null) {
                o.m_forms = m_forms.ConvertAll(o => o?.Clone());
            }
            if (m_quests != null) {
                o.m_quests = m_quests.ConvertAll(o => o?.Clone());
            }
            if (m_committedQuestList != null) {
                o.m_committedQuestList = new (m_committedQuestList);
            }
            if (m_failQuestList != null) {
                o.m_failQuestList = new (m_failQuestList);
            }
            o.newMailCount = newMailCount;
            if (m_equipSkins != null) {
                o.m_equipSkins = new (m_equipSkins);
            }
            o.portableItemId = portableItemId;
            o.trackQuestCid = trackQuestCid;
            if (m_mallBuyCountRecords != null) {
                o.m_mallBuyCountRecords = new (m_mallBuyCountRecords);
            }
            if (m_mallStartSellTime != null) {
                o.m_mallStartSellTime = new (m_mallStartSellTime);
            }
            if (m_payCount != null) {
                o.m_payCount = new (m_payCount);
            }
            if (m_monthCard != null) {
                o.m_monthCard = new (m_monthCard);
            }
            if (m_pets != null) {
                o.m_pets = m_pets.ConvertAll(o => o?.Clone());
            }
            o.petBagCapacity = petBagCapacity;
            if (mainCityPOD != null) {
                o.mainCityPOD = mainCityPOD.Clone();
            }
            if (m_levelRecords != null) {
                o.m_levelRecords = m_levelRecords.ConvertAll(o => o?.Clone());
            }
            if (m_friends != null) {
                o.m_friends = m_friends.ConvertAll(o => o?.Clone());
            }
            return o;
        }
        
        public void Clear() {
            pid = default;
            uid = default;
            guid = default;
            openId = default;
            roleCid = default;
            createTime = default;
            areaId = default;
            gameServerId = default;
            sdkName = default;
            channelNo = default;
            level = default;
            exp = default;
            playerName = default;
            avatar = default;
            avatarFrame = default;
            intro = default;
            title = default;
            kanban = default;
            payPoint = default;
            sumPay = default;
            m_functionTypes = default;
            m_playerParams = default;
            m_settingData = default;
            m_basicItems = default;
            m_items = default;
            m_itemCdInfo = default;
            m_itemDebts = default;
            m_exchangeRecords = default;
            m_souls = default;
            m_heros = default;
            defFormId = default;
            m_forms = default;
            m_quests = default;
            m_committedQuestList = default;
            m_failQuestList = default;
            newMailCount = default;
            m_equipSkins = default;
            portableItemId = default;
            trackQuestCid = default;
            m_mallBuyCountRecords = default;
            m_mallStartSellTime = default;
            m_payCount = default;
            m_monthCard = default;
            m_pets = default;
            petBagCapacity = default;
            mainCityPOD = default;
            m_levelRecords = default;
            m_friends = default;
        }
		
        public override string ToString() {
			string str = "";
			str += "PlayerPOD [";
			str += "pid=";
			str += pid;
			str += ", uid=";
			str += uid;
			str += ", guid=";
			str += guid;
			str += ", openId=";
			str += openId;
			str += ", roleCid=";
			str += roleCid;
			str += ", createTime=";
			str += createTime;
			str += ", areaId=";
			str += areaId;
			str += ", gameServerId=";
			str += gameServerId;
			str += ", sdkName=";
			str += sdkName;
			str += ", channelNo=";
			str += channelNo;
			str += ", level=";
			str += level;
			str += ", exp=";
			str += exp;
			str += ", playerName=";
			str += playerName;
			str += ", avatar=";
			str += avatar;
			str += ", avatarFrame=";
			str += avatarFrame;
			str += ", intro=";
			str += intro;
			str += ", title=";
			str += title;
			str += ", kanban=";
			str += kanban;
			str += ", payPoint=";
			str += payPoint;
			str += ", sumPay=";
			str += sumPay;
			str += ", functionTypes=";
			str += m_functionTypes.ToString<int>();
			str += ", playerParams=";
			str += m_playerParams.ToString<int, int>();
			str += ", settingData=";
			str += m_settingData.ToString<string, string>();
			str += ", basicItems=";
			str += m_basicItems.ToString<int, int>();
			str += ", items=";
			str += m_items.ToString<ItemPOD>();
			str += ", itemCdInfo=";
			str += m_itemCdInfo.ToString<int, int>();
			str += ", itemDebts=";
			str += m_itemDebts.ToString<int, int>();
			str += ", exchangeRecords=";
			str += m_exchangeRecords.ToString<int, int>();
			str += ", souls=";
			str += m_souls.ToString<SoulPOD>();
			str += ", heros=";
			str += m_heros.ToString<HeroPOD>();
			str += ", defFormId=";
			str += defFormId;
			str += ", forms=";
			str += m_forms.ToString<FormationPOD>();
			str += ", quests=";
			str += m_quests.ToString<QuestPOD>();
			str += ", committedQuestList=";
			str += m_committedQuestList.ToString<int>();
			str += ", failQuestList=";
			str += m_failQuestList.ToString<int>();
			str += ", newMailCount=";
			str += newMailCount;
			str += ", equipSkins=";
			str += m_equipSkins.ToString<int>();
			str += ", portableItemId=";
			str += portableItemId;
			str += ", trackQuestCid=";
			str += trackQuestCid;
			str += ", mallBuyCountRecords=";
			str += m_mallBuyCountRecords.ToString<int, int>();
			str += ", mallStartSellTime=";
			str += m_mallStartSellTime.ToString<int, int>();
			str += ", payCount=";
			str += m_payCount.ToString<int, int>();
			str += ", monthCard=";
			str += m_monthCard.ToString<int, int>();
			str += ", pets=";
			str += m_pets.ToString<PetPOD>();
			str += ", petBagCapacity=";
			str += petBagCapacity;
			str += ", mainCityPOD=";
			str += mainCityPOD;
			str += ", levelRecords=";
			str += m_levelRecords.ToString<LevelRecordPOD>();
			str += ", friends=";
			str += m_friends.ToString<FriendPOD>();
			str += "]";
			return str;
		}
		
	}
}